<?php

namespace App\Plugins\Wechat;


final class SETTING
{
    // 微信常用地址注册
    const LOGIN_QRCODE_URL = 'https://login.weixin.qq.com/l/';
    // 登录状态
    const LOGIN_STARTING = 100;
    const LOGIN_WAIT_SCAN = 101;
    const LOGIN_WAIT_CONFIRM = 102;
    const LOGIN_SUCCESS = 103;

    // 队列用常量注册
    const CMD_CHANNEL_NAME = 'wxm:commands';
    const UIN_MAP_UUID = 'wxm:%s:uuid';
    const FREE_UUID_LIST = 'wxm:uuid:frees';
    const UUID_LOGIN_STATUS = 'wxm:uuid:status';
    const ONLINE_CLIENTS = 'wxm:clients:online';
    const COMMAND_QUEUE = 'wxm:action:%s:%s';

    // 消息类型
    const TEXT_MSG = 'text_msg';
    const VOICE_MSG = 'voice_msg';
    const IMAGE_MSG = 'image_msg';
    const SYS_MSG = 'sys_msg';
    const VERIFY_MSG = 'verify_msg';

    const MAP_NORMAL_MSG = [
        self::TEXT_MSG,
        self::VOICE_MSG,
        self::IMAGE_MSG,
        self::SYS_MSG,
        self::VERIFY_MSG,
    ];

    const MAP_MSG_TYPE = [
        self::TEXT_MSG,
        self::VOICE_MSG,
        self::IMAGE_MSG,
    ];

    const ACTION_MAP = [
        self::TEXT_MSG => 'send_msg',
        self::VERIFY_MSG => 'send_msg',
    ];

    const CLIENT_INFO = 'wxm:client:%s';
}